# _*_ coding: utf-8 _*_
from odoo import models, fields, api


class StockMonthBalanceClear(models.TransientModel):
    _name = "stock.month.balance.clear"

    calendar_id = fields.Many2one('resource.calendar', u'期间', required=True, domain=[('inout_close', '!=', True)])

    def action_clear(self):
        self.env.cr.execute("""delete from stock_month_balance where month = %s""", (self.calendar_id.id,))
        return True
